package kr.saeildamil.androidstudty.ch18;

import kr.saeildamil.androidstudty.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class ApplicationTest extends Activity {
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch18_applicationtest);
		
		updateNowMode();
	}
	private void updateNowMode() {
		TextView tv = (TextView) findViewById(R.id.ch18_applicationtest_mode);
		AndroidStudyApplication app = (AndroidStudyApplication) getApplication();
		if(app.getmMode() == AndroidStudyApplication.BEGINNER){
			tv.setText("현재 모드 : 초보자 모드");
		}else{
			tv.setText("현재 모드 : 숙련자 모드");
		}
		
	}
	public void mOnClick(View v){
		AndroidStudyApplication app = (AndroidStudyApplication) getApplication();
		switch(v.getId()){
		case R.id.ch18_applicationtes_beginner:
			app.setmMode(AndroidStudyApplication.BEGINNER);
			break;
		case R.id.ch18_applicationtes_professional:
			app.setmMode(AndroidStudyApplication.PROFESSIONAL);
			break;
		}
		updateNowMode();
		
	}

}
